﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using ADC.DAL;
using ADC.DAL;
using ADC.BL;

namespace ADC.Web.Admin
{
    public partial class Default : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            // get USER_SESSION_COUNT
            ApplicationObject appObject = new ApplicationObject();
            appObject = ApplicationObjectFactory.getByName(ApplicationObjectFactory.USER_SESSION_COUNT);
            if (appObject != null)
            {
                lblTotalUserSession.Text = "" + appObject.ApplicationObjectValueLong;
                if (appObject.ApplicationObjectValueDatetime != null)
                {
                    lblTotalVisitSinceDate.Text = ((DateTime)appObject.ApplicationObjectValueDatetime).ToString("dd/MM/yyyy");
                }
            }

            lblUserOnline.Text = "" + (long)Application["VisitorsAreOnline"];

            //get MAX_USER_ONLINE
            ApplicationObject appObjectMaxUserOnline = new ApplicationObject();
            appObjectMaxUserOnline = ApplicationObjectFactory.getByName(ApplicationObjectFactory.MAX_USER_ONLINE);
            if (appObjectMaxUserOnline != null)
            {
                lblMaxUserOnline.Text = "" + appObjectMaxUserOnline.ApplicationObjectValueLong;
                lblTimeMaxUserOnline.Text = ((DateTime)appObjectMaxUserOnline.ApplicationObjectValueDatetime).ToString("dd/MM/yyyy HH:mm:ss");
            }


            //Label1.Text = "Session Items Count:" + (long)Application["SessionCount"];
            //Label1.Text += "<br />Page view cout :" + (long)Application["PageViewCout"];
        }
    }
}